#!/bin/sh
# trap.sh - Using trap to handle singnals
########################################

# 重新定义了对信号'CTRL-C'的响应
trap "echo 'Do not interrupt me!'" INT
# 重新定义了对信号'CTRL-Z'的响应
trap "echo 'Attempted murder is illegal!'" TERM

echo "$0's PID is $$"   # $$为当前脚本PID

#while true; # 等效于 while [ true ]
while [ true ]
do
    echo '11'
    sleep 10
done
